package cn.webrx;

import java.util.Calendar;
import java.util.Date;
import java.util.TimeZone;

public class Ex {
    public static void main(String[] args) {
        //Calendar

        Calendar c = Calendar.getInstance(TimeZone.getTimeZone("PRC"));
        System.out.printf("%tF %<tT%n",c);

        Calendar c2 = Calendar.getInstance(TimeZone.getTimeZone("en_UK"));
        System.out.printf("%tF %<tT%n",c2);

        //c.get();

        //c.set();

        System.out.println(c.getTimeInMillis());
        System.out.println(c.getTimeZone());

        //Calendar 转 Date
        Date ddd = c.getTime();

        System.out.println();
        System.out.printf("%tF",1658970437636L);

        //PRC

        //Date (年月日时分秒毫秒，时间戳（）)
        Date d3 = new Date(1658970437636L);

        System.out.println(d3.getTime());

        //Date 转 Calendar
        Calendar ccc = Calendar.getInstance();
        ccc.setTime(d3);


    }
}
